package com.xjh.basestudy.designmode.behaviorMode.behaviorMode9_Visitor.p2_batch;

import java.time.LocalDate;

/**
 * @Author XuJianHua
 * @Date 2022/10/5 21:15
 * @Description 商品类：抽取商品的共同属性（名称/生产日期/单品价格）
 * <p>
 * 假设货架上的商品有糖果类、酒类和水果类，除各自的特征之外，它们应该拥有一些类似的属性与方法。为了简化代码，我们将这些通用的数据封装，抽象到商品父类中去，
 */
public abstract class Product {

    private String name;// 商品名
    private LocalDate producedDate;// 生产日期
    private float price;// 单品价格

    public Product(String name, LocalDate producedDate, float price) {
        this.name = name;
        this.producedDate = producedDate;
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public LocalDate getProducedDate() {
        return producedDate;
    }

    public void setProducedDate(LocalDate producedDate) {
        this.producedDate = producedDate;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

}